Skip to content

ci: deployment stack, CI/CD pipelines and observability-ready backend - #35

Closed
RayaneHassani wants to merge 23 commits into
devfrom
feat/devops-ci-cd
Closed

ci: deployment stack, CI/CD pipelines and observability-ready backend#35
RayaneHassani wants to merge 23 commits into
devfrom
feat/devops-ci-cd

Conversation

@RayaneHassani

Copy link
Copy Markdown

Description :

Summary

Adds the self-hosting deployment stack, GitHub + GitLab CI/CD pipelines,
and the minimal backend changes needed for production observability.

Deployment (build-on-VPS)

  • install.sh: day-0 bootstrap — Docker, host hardening (ufw + fail2ban),
    generates .env with random secrets (interactive or env-var driven),
    builds the stack and waits for backend health.
  • update.sh: day-N updater — pull, rebuild, health-check, with DB backup
    and automatic rollback (code + database) on failure.
  • Caddyfile + docker-compose.prod.yml: reverse proxy with automatic
    HTTPS; app ports bound to loopback so only Caddy is public.
  • deploy/systemd/: optional service + timer for scheduled local updates.

CI (fast feedback — ci.yml, push/PR on dev & main)

  • Path-filtered jobs: frontend (lint, typecheck, build), backend
    (compile, test, JaCoCo), docker compose build.
  • Governance guards: Flyway migration integrity, i18n key parity.
  • gitleaks secret scan, dependency review on PRs.
  • Single aggregate ci-required status check for branch protection.

Security (heavy — security.yml, main + nightly)

  • CodeQL (Java, JS/TS), Trivy (filesystem + config) to code scanning.
  • OpenSSF Scorecard, CycloneDX SBOM with build-provenance attestation.

CD (deploy.yml)

  • SSH-based deployment running update.sh; prod (main) and staging (dev)
    targets, each gated by a repo variable so forks skip it cleanly.

Supporting

  • .gitlab-ci.yml: GitLab mirror reusing scripts/ci/ and native security templates.
  • dependabot.yml: per-directory updates; ignores the Next.js fork.
  • Backend: Prometheus metrics, JSON logs (prod), liveness/readiness probes.
  • README CI / Security / Scorecard / license badges.
  • All third-party actions pinned by commit SHA.

Notes

  • Workflows trigger on dev/main; this PR is the first run.
  • CD stays inactive until vars.HAS_PROD / HAS_STAGING and SSH secrets are set.

AntoninMignotPilon and others added 19 commits June 21, 2026 17:48
…subtle delete

- Replace flat outline buttons with full-width clickable rows (icon + label + arrow)
- Add colour-coded avatar circle derived deterministically from group slug
- Move delete action to a discrete icon button (only visible on hover)
- Show date range as a GlassChip instead of plain text
- Fix hydration mismatch by passing explicit fr-FR locale to toLocaleDateString
- install.sh: bootstrap (Docker, ufw, fail2ban), generates .env with
  random secrets, builds the stack and waits for backend health
- Caddyfile: reverse proxy with automatic HTTPS, domain from DOMAIN env
- docker-compose.prod.yml: production overlay running Caddy on 80/443
- docker-compose.yml: bind app ports to 127.0.0.1 (only Caddy is public)
- .gitignore: ignore per-instance config/
- .gitattributes: enforce LF line endings
- ask(): always return 0 (a non-empty answer with no default made the
  trailing test return non-zero, which set -e turned into an exit)
- create .env only after all prompts succeed (no half-written file)
- update.sh: pull, rebuild, health-check; on failure rolls back code
  and restores the pre-update database dump. Flags: --yes, --no-backup.
  Single-instance lock; keeps the last 7 DB backups.
- deploy/systemd: optional service + timer for scheduled local updates
- .gitignore: ignore /backups/
- add micrometer-registry-prometheus; expose health, info, prometheus
- enable liveness/readiness health probes
- logback-spring.xml: console logs in dev, JSON logs in prod (Loki-ready)
- permit /actuator/info and /actuator/prometheus (internal network only)
- add JaCoCo plugin for coverage reports
- ci.yml: paths-filtered jobs on dev/main (push + PR), concurrency cancel
  - frontend: lint, typecheck, build
  - backend: compile, verify (test + JaCoCo), coverage artifact
  - governance: Flyway migration + i18n parity guards
  - secrets: gitleaks; dependency-review on PRs; docker compose build
  - ci-required: single aggregate status check for branch protection
- scripts/ci: flyway-governance.sh, i18n-parity.sh (shared with GitLab later)
- frontend: add typecheck script (tsc --noEmit)
- third-party actions pinned by commit SHA
- remove build-services.yml (superseded)
- CodeQL SAST for Java and JavaScript/TypeScript
- Trivy filesystem and config scans, results to GitHub code scanning
- OpenSSF Scorecard with published results
- CycloneDX SBOM with build-provenance attestation
- third-party actions pinned by commit SHA
- deploy.yml: SSH-based CD running update.sh on the server; prod (main)
  and staging (dev) targets, each gated by a repo variable so forks skip it
- dependabot.yml: per-directory updates (maven, npm, docker, actions);
  groups minor/patch; ignores the Next.js fork
- .gitlab-ci.yml: mirror reusing scripts/ci and native GitLab security templates
- README: CI, Security, Scorecard and license badges
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5ba3abdd-8b46-48ff-9e1c-3073e1350f2a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/devops-ci-cd

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

# Conflicts:
#	apps/backend/src/main/resources/instance.json
- backend job: add ephemeral Postgres service so @SpringBootTest can load
- secrets job: run gitleaks binary directly (no org license required)
- fix unescaped quotes in ai-generator-form
- add missing French bookmarks translations (i18n parity)
- notify job aggregates frontend, backend, governance, secrets, docker
- no-ops when DISCORD_WEBHOOK_URL is unset (fork-safe); action pinned by SHA
Add docker-compose.monitoring.yml with Prometheus, Grafana, Loki,
Promtail, node-exporter and cAdvisor, all bound to the internal
network with no public port. Grafana is reachable via SSH tunnel only.

Prometheus scrapes the backend, host, containers and Caddy; retention
is 15d for metrics and 7d for logs. Grafana ships provisioned
datasources and dashboards (JVM/Spring, VPS system, containers, logs).

Expose Caddy's admin metrics endpoint on the internal network and add
a `make monitoring` target plus README instructions.

@teamssUTXO teamssUTXO left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RayaneHassani Il faudrait que tu merge la dev sur ta branche pour qu'elle soit à jour et sans conflits.

@RayaneHassani RayaneHassani mentioned this pull request Jul 14, 2026
@RayaneHassani

Copy link
Copy Markdown
Author

Closing this PR in favor of a new one: feat/ci-cd → dev.

This branch contains more than the CI/CD work. It also carries in progress frontend redesign (commit 07337de — dark/light theme, learn/studio pages, new home) and original groups commits, which are now superseded by the newer version merged in #37 . Merging this branch would push unreviewed WIP into dev and mix DevOps and frontend changes in one review.

I recreated a clean branch feat/ci-cd from dev with only the CI/CD commits (workflows, VPS installer, monitoring, backend observability). The content is identical to what was here, verified by diff. Two frontend hunks from ffe18b1 (ai-generator-form quotes, bookmarks translations) were dropped because dev already fixes them.

Do not delete feat/devops-ci-cd, the only copy of frontend redesign.

New PR: #37

@github-project-automation github-project-automation Bot moved this from Backlog to Done in codestar roadmap Jul 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants